package com.foreveross.proxyip.monitor.infra.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.foreveross.proxyip.entity.ExtractLogEntity;
import com.foreveross.proxyip.infra.base.ddd.repository.EntityHibernateRepository;
import com.foreveross.proxyip.monitor.infra.SourceRecordRepository;

@Repository
public class SourceRecordRepositoryImpl extends EntityHibernateRepository implements SourceRecordRepository {

	@Override
	public List<ExtractLogEntity> findByHQL(String hql, Object[] params,
			int pageIndex, int pageLen) throws Exception {
		
		try {
			//return super.find(hql, params, RetrieveIpEntity.class);
			return super.queryResult(hql, params,pageIndex,pageLen);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
	}

	@Override
	public long findSizeByHQL(String hql, Object[] params) throws Exception {
		try {
			return super.queryResultSize(hql, params);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return 0;
		}
	}

}
